<template>
	<view>
		<u-navbar :is-back="false" title="　" :border-bottom="false">
			<view class="u-flex u-row-right" style="width: 100%;">
				<view class="camera u-flex u-row-center">
				</view>
			</view>
		</u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<u-avatar :src="pic" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20" v-model="workName">{{workName}}</view>
				<view class="u-font-14 u-tips-color" v-model="workNum">员工工号:{{workNum}}</view>
			</view>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="account" title="个人信息" @click="toPersonInfo"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="order" title="指定特殊工位" @click="toSpecialStation"></u-cell-item>
				<u-cell-item icon="level" title="重点工序工位" @click="toKeyPoint"></u-cell-item>
				<u-cell-item icon="info" title="工序1扫码记录" @click="toprocess1scan"></u-cell-item>
				<u-cell-item icon="error-circle" title="异常报警" @click="toDealError"></u-cell-item>
				<u-cell-item icon="red-packet" title="绩效查询" @click="toPerformancePage"></u-cell-item>
				<u-cell-item icon="file-text" title="指定线下维修" @click="downMaintenance" v-if="user.departmentName == 'EMS总装车间'"></u-cell-item>
				<u-cell-item icon="file-text" title="维修记录" @click="toFeedBackForm" v-if="user.departmentName == 'EMS总装车间'"></u-cell-item>
				<u-cell-item icon="file-text" title="设备点检" @click="toSpotCheckList('设备点检')"></u-cell-item>
				<u-cell-item icon="file-text" title="设备保养" @click="toSpotCheckList('设备保养')"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
import { accessPersonInfo } from '../../utils/index.js'
	export default {
		data() {
			return {
				workName:'',
				workNum:'',
				pic:'',
				show:true,
				feedbackForm: uni.getStorageSync('feedbackForm'),
				user: uni.getStorageSync('user'),
			}
		},
		onLoad() {
			this.getUserInfo()
		},
		methods: {
			toSpotCheckList(name){
				uni.navigateTo({
					url:'../../publicPage/spotCheckList?name=' + name
				})
			},
			toFeedBackForm(){
				uni.navigateTo({
					url:'../../publicPage/feedBackForm'
				})
			},
			toPersonInfo(){
				uni.navigateTo({
					url:'../../publicPage/personInfo'
				})
			},
			// 跳转特殊工位
			toSpecialStation() {
				uni.navigateTo({
					url:'./specialStation'
				})
			},
			toprocess1scan(){
				uni.navigateTo({
					url:'./process1scan'
				})
			},
			toKeyPoint() {
				uni.navigateTo({
					url:'./appoint'
				})
			},
			// 跳转绩效查询页面
			toPerformancePage(){
				uni.navigateTo({
					url:'../../publicPage/performance'
				})
			},
			toDealError() {
				uni.navigateTo({
					url:'./getErrorList'
				})
			},
			downMaintenance(){
				uni.navigateTo({
					url:"../../pages/QC/childPage/downMaintenance?feedbackPlanNo=" + ''
						+ '&deviceBarcode=' + ''
						+ '&feedbackWorkOrderNo=' + ''
						+ '&feedbackOrderType=' + ''
						+ '&feedbackProcessOrder=' + ''
						+ '&processName=' + ''
						+ '&feedbackName=' + ''
						+ '&isCraft=' + true
				})
			},
			async getUserInfo(){
				const {data} = await accessPersonInfo()
				this.workName = data.data.userName;
				this.workNum = data.data.jobNumber;
				this.pic = data.data.imageUrl;
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}
</style>